package com.hzqy.web.ac.street;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hzqy.service.street.AreaStreetServiceBean;
import com.hzqy.web.filter.LoginFilter;
import com.hzqy.web.vo.SysAreaStreetVo;

@Controller
@RequestMapping("/")
public class AreaStreetAction {
	private static final Log LOG = LogFactory.getLog(LoginFilter.class);
	@Resource
	private AreaStreetServiceBean areaStreetServiceBean;
	
	@RequestMapping("/street/selectAreaStreet")
	@ResponseBody
	public Object selectAreaStreet(SysAreaStreetVo sysAreaStreetVo) {
		LOG.debug("enter");
		List<SysAreaStreetVo> areaList= new ArrayList<SysAreaStreetVo>();
		areaList = areaStreetServiceBean.selectAreaStreet(sysAreaStreetVo);
		LOG.debug(areaList);
		return areaList;
	}
	
	@RequestMapping("/street/selectById")
	@ResponseBody
	public Object selectById (int f_sas_id) {
		SysAreaStreetVo areaList= new SysAreaStreetVo();
		areaList = areaStreetServiceBean.selectById(f_sas_id);
		return areaList;
	}
	
	@RequestMapping("/street/selectByName")
	@ResponseBody
	public Object selectByName (SysAreaStreetVo sysAreaStreetVo) {
		SysAreaStreetVo areaList = areaStreetServiceBean.selectByName(sysAreaStreetVo);
		if(areaList == null) {
			areaList = new SysAreaStreetVo();
		}
		return areaList;
	}
		
}
